package org.sport.repository;


import org.sport.model.entityModel.ActivitytableEntity;
import org.sport.model.entityModel.ActlinuserEntity;
import org.sport.model.entityModel.UsertableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Repository
public interface ActLinUserRepository extends JpaRepository<ActlinuserEntity,Integer> {


    @Transactional
    @Query("select act from ActlinuserEntity act where act.activitytableByActId =?1")
    public List<ActlinuserEntity> findUserByAId(ActivitytableEntity actId);



    @Transactional
    @Query("select act from ActlinuserEntity act where act.usertableByUserId =?1")
    public List<ActlinuserEntity> findActByUserId(UsertableEntity userId);
}
